package core;

import java.util.Vector;
import response.GameResponse;

/**
 * This class is user object which stored on server side
 * each user contains movement, id, model, and other info
 *
 * @author eric, yiyi, Zoran, Gary
 */
public class GameUser {

    // User Information
    private int user_id;
    private String username;
    private int student_id;
    private String first_name;
    private String last_name;
    private short gender;
    private String email;
    private short level;
    private boolean online;
    // Other Information
    private GameCharacter character;
    // Extra Information
    private long client_id;
    private long last_save_time;
    private Vector<GameResponse> updates;
    private Vector<Message> invites;
    private Vector<Message> privateChats;

    public GameUser(int user_id) {
        this.user_id = user_id;

        updates = new Vector<GameResponse>();
        invites = new Vector<Message>();
        privateChats = new Vector<Message>();
    }

    public int getID() {
        return user_id;
    }

    public int setID(int user_id) {
        return this.user_id = user_id;
    }

    public String getUsername() {
        return username;
    }

    public String setUsername(String username) {
        return this.username = username;
    }

    public int getStudentID() {
        return student_id;
    }

    public int setStudentID(int student_id) {
        return this.student_id = student_id;
    }

    public String getFirstName() {
        return first_name;
    }

    public String setFirstName(String first_name) {
        return this.first_name = first_name;
    }

    public String getLastName() {
        return last_name;
    }

    public String setLastName(String last_name) {
        return this.last_name = last_name;
    }

    public short getGender() {
        return gender;
    }

    public short setGender(short gender) {
        return this.gender = gender;
    }

    public String getEmail() {
        return email;
    }

    public String setEmail(String email) {
        return this.email = email;
    }

    public short getLevel() {
        return level;
    }

    public short setLevel(short level) {
        return this.level = level;
    }

    public boolean getOnline() {
        return online;
    }

    public boolean setOnline(boolean online) {
        return this.online = online;
    }
    
    public GameCharacter getCharacter() {
        return character;
    }

    public GameCharacter setCharacter(GameCharacter character) {
        return this.character = character;
    }

    public long getClientID() {
        return client_id;
    }

    public long setClientID(long client_id) {
        return this.client_id = client_id;
    }

    public long getLastSaveTime() {
        return last_save_time;
    }

    public long setLastSaveTime(long last_save_time) {
        return this.last_save_time = last_save_time;
    }

    /**
     * Adds an update response to this user's list.
     */
    public void queueUpdateResponse(GameResponse response) {
        updates.add(response);
    }

    /**
     * Returns all update response.
     * @return vector of updates for this user.
     */
    public Vector<GameResponse> getUpdateResponses() {
        return updates;
    }

    /**
     * Removes all update response.
     */
    public void clearUpdateResponses() {
        updates.clear();
    }
}

